﻿package extend.language
{
    import com.gengine.utils.*;
    import com.mui.serialization.json.*;

    public class Language extends Object
    {

        public function Language()
        {
            return;
        }// end function

        public static function getString(param1:int) : String
        {
            return LanguageConfig.instance.getString(param1);
        }// end function

        public static function getArray(param1:int, param2:String = "label") : Array
        {
            var _loc_5:Array = null;
            var _loc_7:Object = null;
            var _loc_3:* = LanguageConfig.instance.getString(param1);
            var _loc_4:* = _loc_3.split(",");
            var _loc_6:Array = [];
            var _loc_8:int = 0;
            while (_loc_8 < _loc_4.length)
            {
                
                _loc_5 = String(_loc_4[_loc_8]).split("|");
                _loc_7 = {name:_loc_5[0]};
                _loc_7[param2] = _loc_5[1];
                _loc_6.push(_loc_7);
                _loc_8++;
            }
            return _loc_6;
        }// end function

        public static function getJSON(param1:int) : Object
        {
            var _loc_2:* = LanguageConfig.instance.getString(param1);
            return JSON.deserialize(_loc_2);
        }// end function

        public static function getStringByParam(param1:int, ... args) : String
        {
            args = LanguageConfig.instance.getString(param1);
            return StringHelper.substitute(args, args);
        }// end function

        public static function getArrayByStr(param1:int) : Array
        {
            var _loc_2:* = LanguageConfig.instance.getString(param1);
            return _loc_2.split(",");
        }// end function

    }
}
